﻿@using EquipmentManager.Entities
@model EquipmentManager.Models.CreateModel<EquipmentBase>

@{
    ViewBag.Title = "Редактировать оборудование " + Model.Instance.Name;
}

@section menu {
    <section class="featured">
            <div class="master-menu">
                @{Html.RenderPartial("OperatorMenu");}
            </div>
    </section>
}

<h2>Редактировать оборудование @Model.Instance.Name</h2>

@using (Html.BeginForm("EditEquipment", "Operator", FormMethod.Post, new { @class = "" }))
{   
    @Html.HiddenFor(model => model.Instance.Id)
    @Html.HiddenFor(model => model.Instance.Status)
    @Html.HiddenFor(model => model.ParentId)
    
    <table class="bordered">
         <tr>
            <td class="vertical-header">Инвентарный номер</td>
            <td>@Html.EditorFor(model => model.Instance.Number, new { @class = "" })</td>
        </tr>
         <tr>
            <td class="vertical-header">Серийный номер</td>
            <td>@Html.EditorFor(model => model.Instance.SerialNumber, new { @class = "" })</td>
        </tr>
        <tr>
            <td class="vertical-header">Название</td>
            <td>@Html.EditorFor(model => model.Instance.Name, new { @class = "" })</td>
        </tr>
        <tr>
            <td class="vertical-header">Описание</td>
            <td>@Html.EditorFor(model => model.Instance.Description, new { @class = "" })</td>
        </tr>
        <tr>
            <td class="vertical-header">Год</td>
            <td>@Html.EditorFor(model => model.Instance.Year, new { @class = "" })</td>
        </tr>
        <tr>
            <td class="vertical-header">Рабочее место</td>
            <td>@Html.EditorFor(model => model.Instance.WorkPlace, new { @class = "" })</td>
        </tr>
        <tr>
            <td class="vertical-header">Состояние</td>
            <td>@Html.DropDownListFor(model => model.Instance.State, new SelectList(Enum.GetValues(typeof(State))))</td>
        </tr>
        <tr>
            <td class="vertical-header">Заметка</td>
            <td>@Html.TextAreaFor(model => model.Instance.Note, new { @class = "" })</td>
        </tr>
    </table>
    
    @Html.ValidationSummary();

    <p>
        @Html.ActionLink("Отмена", "Equipments", new { @PostOfficeId = Model.ParentId }, new { @class = "common-btn-large BlueColor" }) <input type="submit" value="ОК" class="common-btn-large BlueColor" />
    </p>
}